package MethodStudy;

/**
 * @author WangXin
 * @version 1.0
 * 用递归方法求1-100的和
 * @date 2021/12/4 16:30
 */
public class Sum {
    public static void main(String args []){
        System.out.println("1-100的和为："+sum(100));
        for(int i=0;i< args.length;i++)System.out.println(" "+args[i]);

    }
    static int sum(int n){
        return n==0?0:n+sum(n-1);
    }
}
